package week01

object Main {;import org.scalaide.worksheet.runtime.library.WorksheetSupport._; def main(args: Array[String])=$execute{;$skip(215); 
  def main(args: Array[String]) {
    println("Pascal's Triangle")
    for (row <- 0 to 10) {
      for (col <- 0 to row)
        print(pascal(col, row) + " ")
      println()
    }
  };System.out.println("""main: (args: Array[String])Unit""");$skip(179); 

  /**
   * Exercise 1
   */
  def pascal(c: Int, r: Int): Int = {
//    if(r==0) 1
//    if((1==c)||(r==c)) 1
    if((0==c)||(r==c)) 1
    else pascal(c-1,r-1)+pascal(c,r-1)
  };System.out.println("""pascal: (c: Int, r: Int)Int""");$skip(145); 
  

  /**
   * Exercise 2
   */
  def balance(chars: List[Char]): Boolean ={
    if (chars.isEmpty) return false;
    else return true;
    
  };System.out.println("""balance: (chars: List[Char])Boolean""");$skip(88); 

  /**
   * Exercise 3
   */
  def countChange(money: Int, coins: List[Int]): Int = ???;System.out.println("""countChange: (money: Int, coins: List[Int])Int""")}
}
